package io.leo.leodata.db;


import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import java.lang.reflect.Method;
import java.util.List;

import io.leo.leoutils.ReflectUtils;

public class BaseSqliteHelper extends SQLiteOpenHelper {
    private Context context;
    private static Class[] beans;
    private List<String> initSql;



    public BaseSqliteHelper(Context context,String dbName,Class...beans){
        this(context,dbName,InitSqlFactory.fromBeans(beans));
    }

    public BaseSqliteHelper(Context context, String dbName, List<String> initSql) {
        super(context, dbName, null, 1);
        this.initSql = initSql;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        for (String sql:initSql)
            db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
